<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加商品</title>
    <!--bootstrap-select  css文件-->
    <link rel="stylesheet" type="text/css" href="js/bootstrapselect/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="js/bootstrapselect/css/bootstrap-select.css"/>
    <!--日期  css文件-->
    <link rel="stylesheet" type="text/css" href="js/datepicker/css/bootstrap-datepicker.css">
    <!--弹窗 css文件-->
    <link rel="stylesheet" type="text/css" href="js/layer/layer.css">
    <!--图片点击放大  css文件-->
    <link rel="stylesheet" href="js/viewer/css/viewer.min.css">
    <!--主要css样式-->
    <link rel="stylesheet" type="text/css" href="css/models.css">
</head>
<body>
<!--添加编辑资讯弹窗-->
<form id="formID">
    <ul class="addList">
        <li>
            <label for=""><span class="require">*</span>商品名称：</label>
            <input class="validate[required]" name="" type="text" placeholder="请输入商品名称">
        </li>
        <li>
            <label for=""><span class="require">*</span>店铺分类：</label>
            <select class="selectpicker validate[required]" data-live-search="true">
                <option value="">全部</option>
                <option value="">冻结</option>
                <option value="">正常</option>
            </select>
        </li>
        <li>
            <label for=""><span class="require">*</span>商品图片：</label>
            <div class="filePhoto uploadImg">
                <section class="fileBox left">
                    <img src="images/add.png" class="add-img">
                    <input type="file" name="file" id="file" class="fileImg" value="" accept="image/jpg,image/jpeg,image/png,image/bmp" multiple/>
                </section>
            </div>
        </li>
        <li>
            <label for=""><span class="require">*</span>商品单价：</label>
            <input class="validate[required]" name="" type="text" placeholder="请输入商品名称">
        </li>
        <li>
            <label for=""><span class="require">*</span>商品单位：</label>
            <input class="validate[required]" name="" type="text" placeholder="请输入商品名称">
        </li>
        <li>
            <label for=""><span class="require">*</span>限购数量：</label>
            <input class="validate[required]" name="" type="text" placeholder="请输入商品名称">
        </li>
    </ul>
</form>
<!--end 添加编辑资讯弹窗-->
<div class="PopupBtn">
    <input class="submit" name="" value="提交" type="button">
    <input class="cancel" name="" value="取消" type="button" onclick="cancel();">
</div>
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<!--bootstrap-select-->
<script type="text/javascript" src="js/bootstrapselect/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrapselect/bootstrap-select.js"></script>
<script type="text/javascript" src="js/bootstrapselect/select.js"></script>
<!--验证-->
<script type="text/javascript" src="js/validat/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="js/validat/jquery.validationEngine.js"></script>
<!--图片上传-->
<script type="text/javascript" src="js/imgUp.js"></script>
<!--图片点击放大-->
<script src="js/viewer/viewer-jquery.min.js"></script>
<!--弹窗-->
<script type="text/javascript" src="js/layer/layer.js"></script>

<script type="text/javascript">
    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
    //关闭iframe
    function cancel(){
        layer.confirm('是否放弃本次编辑，不对数据进行保存?', {
            icon: 3,
            btn: ['确定', '返回'],
            btnAlign: 'c',
            closeBtn: 0,
            btn1: function () {
                parent.layer.close(index);
            },
            btn2: function (index) {
                layer.close(index);
            }
        });
    }
    $(function () {
        $("#formID").validationEngine({
            addPromptClass: 'formError-text',
            showArrow: false,
            promptPosition: 'bottomLeft:10 0'
        });
        //图片点击放大
        $('.zoom-img').viewer({
            url: 'src',
            navbar: false,
            keyboard: true,
            title: true
        });
        $('.PopupBtn').on('click','.submit',function () {
            layer.confirm('确定发布吗？',{
                title: '提示',
                icon: 3,
                btnAlign: 'c',
                closeBtn : 0
            },function(index){
                layer.alert('操作失败', {icon: 2,btnAlign: 'c', closeBtn : 0});
            });
        })
        //图片上传
        $("#file").takungaeImgup({
            formData: {
                'module': 'product',
                'name': 'url',
                'filesname': 'urlfile'
            },
            url: 'http://123.206.8.92:7000/web/attachment/uploadProductImage',
            maxImage: 5,
            isCover: true,
            success: function (data) {

            },
            error: function (err) {
                layer.alert(err, {icon: 2, btnAlign: 'c', closeBtn: 0});
            }
        });

    });
</script>
</body>
</html>